{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "from config import config\n",
    "from train_and_eval import train_test_all\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "config[\"model\"] = \"zssr_with_vdsr\"\n",
    "config[\"metrics\"] =  [\"psnr\", \"ssim\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Starting training on ./data/BSD100/img_001.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04009879607990117\n",
      "Finish evaluation\n",
      "Average psnr: 24.81359233397726\n",
      "Average ssim: 0.837576499881556\n",
      "Starting training on ./data/BSD100/img_002.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.037862817712503646\n",
      "Finish evaluation\n",
      "Average psnr: 28.678728464404738\n",
      "Average ssim: 0.9227351678673195\n",
      "Starting training on ./data/BSD100/img_003.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05052516337998922\n",
      "Finish evaluation\n",
      "Average psnr: 23.084326558814702\n",
      "Average ssim: 0.8597414462314997\n",
      "Starting training on ./data/BSD100/img_004.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.031176906956984184\n",
      "Finish evaluation\n",
      "Average psnr: 32.16961690619479\n",
      "Average ssim: 0.9607369447156761\n",
      "Starting training on ./data/BSD100/img_005.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.045669722611254814\n",
      "Finish evaluation\n",
      "Average psnr: 27.572376072068824\n",
      "Average ssim: 0.9122585810302333\n",
      "Starting training on ./data/BSD100/img_006.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03354633503351563\n",
      "Finish evaluation\n",
      "Average psnr: 33.74466211283392\n",
      "Average ssim: 0.9673226448080734\n",
      "Starting training on ./data/BSD100/img_007.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04714184937568162\n",
      "Finish evaluation\n",
      "Average psnr: 28.724465015303153\n",
      "Average ssim: 0.9356501307411659\n",
      "Starting training on ./data/BSD100/img_008.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.050440206958985385\n",
      "Finish evaluation\n",
      "Average psnr: 20.50698525835042\n",
      "Average ssim: 0.7411149049372154\n",
      "Starting training on ./data/BSD100/img_009.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04360732688675876\n",
      "Finish evaluation\n",
      "Average psnr: 29.331201449304373\n",
      "Average ssim: 0.9371451732611847\n",
      "Starting training on ./data/BSD100/img_010.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.032632150016769765\n",
      "Finish evaluation\n",
      "Average psnr: 30.88398230359552\n",
      "Average ssim: 0.9455714778714466\n",
      "Starting training on ./data/BSD100/img_011.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05566033119239292\n",
      "Finish evaluation\n",
      "Average psnr: 25.71822720574193\n",
      "Average ssim: 0.8972170636341189\n",
      "Starting training on ./data/BSD100/img_012.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.044448136559922045\n",
      "Finish evaluation\n",
      "Average psnr: 25.334665886448402\n",
      "Average ssim: 0.8523466613470992\n",
      "Starting training on ./data/BSD100/img_013.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.036527034918771496\n",
      "Finish evaluation\n",
      "Average psnr: 32.38675937945041\n",
      "Average ssim: 0.958471170490823\n",
      "Starting training on ./data/BSD100/img_014.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03680312016063866\n",
      "Finish evaluation\n",
      "Average psnr: 25.666004645427677\n",
      "Average ssim: 0.8764455748695116\n",
      "Starting training on ./data/BSD100/img_015.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03835160106711815\n",
      "Finish evaluation\n",
      "Average psnr: 26.56498012760472\n",
      "Average ssim: 0.9023159650990814\n",
      "Starting training on ./data/BSD100/img_016.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.059483462853735784\n",
      "Finish evaluation\n",
      "Average psnr: 27.800071193722307\n",
      "Average ssim: 0.938304271875548\n",
      "Starting training on ./data/BSD100/img_017.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.023430766889056986\n",
      "Finish evaluation\n",
      "Average psnr: 30.102277175686815\n",
      "Average ssim: 0.9228297360483584\n",
      "Starting training on ./data/BSD100/img_018.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02892077401251596\n",
      "Finish evaluation\n",
      "Average psnr: 28.97122144370578\n",
      "Average ssim: 0.9299068406167569\n",
      "Starting training on ./data/BSD100/img_019.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.045125605698602154\n",
      "Finish evaluation\n",
      "Average psnr: 26.20180293258237\n",
      "Average ssim: 0.882537060646535\n",
      "Starting training on ./data/BSD100/img_020.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.048715204554883436\n",
      "Finish evaluation\n",
      "Average psnr: 26.998537869303924\n",
      "Average ssim: 0.9232017105604721\n",
      "Starting training on ./data/BSD100/img_021.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.054792025186676245\n",
      "Finish evaluation\n",
      "Average psnr: 23.79898218116431\n",
      "Average ssim: 0.8799663910710507\n",
      "Starting training on ./data/BSD100/img_022.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05133745369965987\n",
      "Finish evaluation\n",
      "Average psnr: 25.36969277726765\n",
      "Average ssim: 0.8762850427134888\n",
      "Starting training on ./data/BSD100/img_023.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04648534760239696\n",
      "Finish evaluation\n",
      "Average psnr: 21.877107362992625\n",
      "Average ssim: 0.7074343612143403\n",
      "Starting training on ./data/BSD100/img_024.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.041084811217391534\n",
      "Finish evaluation\n",
      "Average psnr: 27.809306029422387\n",
      "Average ssim: 0.9347267984379752\n",
      "Starting training on ./data/BSD100/img_025.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04115446888224015\n",
      "Finish evaluation\n",
      "Average psnr: 29.322369262471423\n",
      "Average ssim: 0.9481613742518237\n",
      "Starting training on ./data/BSD100/img_026.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04147319738041595\n",
      "Finish evaluation\n",
      "Average psnr: 29.1123781957454\n",
      "Average ssim: 0.947862117932108\n",
      "Starting training on ./data/BSD100/img_027.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.041684314370916235\n",
      "Finish evaluation\n",
      "Average psnr: 29.09354427632422\n",
      "Average ssim: 0.9192420599221007\n",
      "Starting training on ./data/BSD100/img_028.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.027532636316236248\n",
      "Finish evaluation\n",
      "Average psnr: 30.662876735481195\n",
      "Average ssim: 0.9481317038071947\n",
      "Starting training on ./data/BSD100/img_029.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02572857810700402\n",
      "Finish evaluation\n",
      "Average psnr: 31.554503098590516\n",
      "Average ssim: 0.9586426500352325\n",
      "Starting training on ./data/BSD100/img_030.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.06335834946969368\n",
      "Finish evaluation\n",
      "Average psnr: 21.0588612382759\n",
      "Average ssim: 0.7861722957352111\n",
      "Starting training on ./data/BSD100/img_031.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.036988772481926266\n",
      "Finish evaluation\n",
      "Average psnr: 31.49561502998759\n",
      "Average ssim: 0.9537079406186114\n",
      "Starting training on ./data/BSD100/img_032.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.06196156908011673\n",
      "Finish evaluation\n",
      "Average psnr: 18.29645191079404\n",
      "Average ssim: 0.6129300476770524\n",
      "Starting training on ./data/BSD100/img_033.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.048601478265975766\n",
      "Finish evaluation\n",
      "Average psnr: 27.52578532003585\n",
      "Average ssim: 0.9126648814305917\n",
      "Starting training on ./data/BSD100/img_034.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.043427745957724945\n",
      "Finish evaluation\n",
      "Average psnr: 25.39874594735036\n",
      "Average ssim: 0.9028105733659341\n",
      "Starting training on ./data/BSD100/img_035.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.031026478407251507\n",
      "Finish evaluation\n",
      "Average psnr: 34.253352281823545\n",
      "Average ssim: 0.9669966852964675\n",
      "Starting training on ./data/BSD100/img_036.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04715147498828929\n",
      "Finish evaluation\n",
      "Average psnr: 28.548866988033723\n",
      "Average ssim: 0.9181387062916343\n",
      "Starting training on ./data/BSD100/img_037.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03304956013355527\n",
      "Finish evaluation\n",
      "Average psnr: 24.467220119359318\n",
      "Average ssim: 0.6803557141608422\n",
      "Starting training on ./data/BSD100/img_038.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03726147021769258\n",
      "Finish evaluation\n",
      "Average psnr: 28.402144539424214\n",
      "Average ssim: 0.8913919313961335\n",
      "Starting training on ./data/BSD100/img_039.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03932808482066233\n",
      "Finish evaluation\n",
      "Average psnr: 25.844085748390736\n",
      "Average ssim: 0.8459467023800894\n",
      "Starting training on ./data/BSD100/img_040.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03710323825238165\n",
      "Finish evaluation\n",
      "Average psnr: 34.27404611831406\n",
      "Average ssim: 0.9807892297551343\n",
      "Starting training on ./data/BSD100/img_041.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04759283336228978\n",
      "Finish evaluation\n",
      "Average psnr: 27.75155072376599\n",
      "Average ssim: 0.9116210445927057\n",
      "Starting training on ./data/BSD100/img_042.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03954089232640657\n",
      "Finish evaluation\n",
      "Average psnr: 26.08086811731663\n",
      "Average ssim: 0.8642568915609438\n",
      "Starting training on ./data/BSD100/img_043.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.035025207514241194\n",
      "Finish evaluation\n",
      "Average psnr: 27.57690073862738\n",
      "Average ssim: 0.9108123477672597\n",
      "Starting training on ./data/BSD100/img_044.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.045907867190486874\n",
      "Finish evaluation\n",
      "Average psnr: 27.915271906537143\n",
      "Average ssim: 0.9473443215436795\n",
      "Starting training on ./data/BSD100/img_045.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03724535972814448\n",
      "Finish evaluation\n",
      "Average psnr: 25.091673310541196\n",
      "Average ssim: 0.8431165802642773\n",
      "Starting training on ./data/BSD100/img_046.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.023532745983569813\n",
      "Finish evaluation\n",
      "Average psnr: 32.4905846565293\n",
      "Average ssim: 0.9528959618715445\n",
      "Starting training on ./data/BSD100/img_047.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05330579708728975\n",
      "Finish evaluation\n",
      "Average psnr: 24.49879504109724\n",
      "Average ssim: 0.8733963261519783\n",
      "Starting training on ./data/BSD100/img_048.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.038326286778780756\n",
      "Finish evaluation\n",
      "Average psnr: 26.153682192480993\n",
      "Average ssim: 0.8625432645643349\n",
      "Starting training on ./data/BSD100/img_049.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.06579618518626354\n",
      "Finish evaluation\n",
      "Average psnr: 27.810877620571183\n",
      "Average ssim: 0.9547567420894327\n",
      "Starting training on ./data/BSD100/img_050.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.027327945663890286\n",
      "Finish evaluation\n",
      "Average psnr: 32.43269450428909\n",
      "Average ssim: 0.9437131901847403\n",
      "Starting training on ./data/BSD100/img_051.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04974491592827169\n",
      "Finish evaluation\n",
      "Average psnr: 25.921689681405894\n",
      "Average ssim: 0.8654599483206559\n",
      "Starting training on ./data/BSD100/img_052.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04351716531040422\n",
      "Finish evaluation\n",
      "Average psnr: 23.969721961087657\n",
      "Average ssim: 0.8779706401781429\n",
      "Starting training on ./data/BSD100/img_053.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03314828301650356\n",
      "Finish evaluation\n",
      "Average psnr: 32.57890517151204\n",
      "Average ssim: 0.9478575482509163\n",
      "Starting training on ./data/BSD100/img_054.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02640726021796755\n",
      "Finish evaluation\n",
      "Average psnr: 33.27790113485216\n",
      "Average ssim: 0.9393788097917213\n",
      "Starting training on ./data/BSD100/img_055.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04719039341527342\n",
      "Finish evaluation\n",
      "Average psnr: 29.08882684912332\n",
      "Average ssim: 0.9332212666946612\n",
      "Starting training on ./data/BSD100/img_056.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.044173575562884565\n",
      "Finish evaluation\n",
      "Average psnr: 26.900351101822686\n",
      "Average ssim: 0.9008796033086117\n",
      "Starting training on ./data/BSD100/img_057.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05895629275172232\n",
      "Finish evaluation\n",
      "Average psnr: 18.461602362242914\n",
      "Average ssim: 0.603528747999236\n",
      "Starting training on ./data/BSD100/img_058.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03340951632255098\n",
      "Finish evaluation\n",
      "Average psnr: 28.484089602925714\n",
      "Average ssim: 0.8967056722489496\n",
      "Starting training on ./data/BSD100/img_059.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.025761528450744368\n",
      "Finish evaluation\n",
      "Average psnr: 32.05550807191311\n",
      "Average ssim: 0.9360411783605178\n",
      "Starting training on ./data/BSD100/img_060.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03018248200110615\n",
      "Finish evaluation\n",
      "Average psnr: 27.17534493999553\n",
      "Average ssim: 0.8486002447905473\n",
      "Starting training on ./data/BSD100/img_061.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.023150945474336486\n",
      "Finish evaluation\n",
      "Average psnr: 31.87607900645319\n",
      "Average ssim: 0.9366992870793104\n",
      "Starting training on ./data/BSD100/img_062.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03161684328653045\n",
      "Finish evaluation\n",
      "Average psnr: 29.55452679512343\n",
      "Average ssim: 0.9291655294145178\n",
      "Starting training on ./data/BSD100/img_063.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03726655540968107\n",
      "Finish evaluation\n",
      "Average psnr: 33.83017654355146\n",
      "Average ssim: 0.9827027883278127\n",
      "Starting training on ./data/BSD100/img_064.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.047199857435436594\n",
      "Finish evaluation\n",
      "Average psnr: 26.080000509314367\n",
      "Average ssim: 0.9019435817182977\n",
      "Starting training on ./data/BSD100/img_065.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.050915465160805015\n",
      "Finish evaluation\n",
      "Average psnr: 23.1675952228014\n",
      "Average ssim: 0.7573808894035743\n",
      "Starting training on ./data/BSD100/img_066.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04573589104227287\n",
      "Finish evaluation\n",
      "Average psnr: 25.672472264054917\n",
      "Average ssim: 0.8713088460845141\n",
      "Starting training on ./data/BSD100/img_067.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.01960062047839264\n",
      "Finish evaluation\n",
      "Average psnr: 36.248498403787174\n",
      "Average ssim: 0.989406435726714\n",
      "Starting training on ./data/BSD100/img_068.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.07181033065372344\n",
      "Finish evaluation\n",
      "Average psnr: 22.943101233560206\n",
      "Average ssim: 0.8641285144773082\n",
      "Starting training on ./data/BSD100/img_069.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04749322854473906\n",
      "Finish evaluation\n",
      "Average psnr: 23.58283237913115\n",
      "Average ssim: 0.8577925975791443\n",
      "Starting training on ./data/BSD100/img_070.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.037911480794999786\n",
      "Finish evaluation\n",
      "Average psnr: 30.3364594037744\n",
      "Average ssim: 0.9481590038936258\n",
      "Starting training on ./data/BSD100/img_071.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.028032047224819806\n",
      "Finish evaluation\n",
      "Average psnr: 30.4802179657551\n",
      "Average ssim: 0.9277928917512289\n",
      "Starting training on ./data/BSD100/img_072.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04749707588535449\n",
      "Finish evaluation\n",
      "Average psnr: 27.241197697697125\n",
      "Average ssim: 0.885172947817027\n",
      "Starting training on ./data/BSD100/img_073.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04118740640103352\n",
      "Finish evaluation\n",
      "Average psnr: 23.94196066349015\n",
      "Average ssim: 0.7608325396137805\n",
      "Starting training on ./data/BSD100/img_074.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04421213576450331\n",
      "Finish evaluation\n",
      "Average psnr: 27.208139223315246\n",
      "Average ssim: 0.889537452474662\n",
      "Starting training on ./data/BSD100/img_075.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05204809418136987\n",
      "Finish evaluation\n",
      "Average psnr: 21.09226939686245\n",
      "Average ssim: 0.7880327798946395\n",
      "Starting training on ./data/BSD100/img_076.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02856050930436981\n",
      "Finish evaluation\n",
      "Average psnr: 27.491743335471803\n",
      "Average ssim: 0.8756375878881005\n",
      "Starting training on ./data/BSD100/img_077.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.041080667998803895\n",
      "Finish evaluation\n",
      "Average psnr: 25.085119393510183\n",
      "Average ssim: 0.8303199603453644\n",
      "Starting training on ./data/BSD100/img_078.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03285832690255953\n",
      "Finish evaluation\n",
      "Average psnr: 31.287082963143675\n",
      "Average ssim: 0.946856656790413\n",
      "Starting training on ./data/BSD100/img_079.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.040072494806928795\n",
      "Finish evaluation\n",
      "Average psnr: 31.057186959443314\n",
      "Average ssim: 0.969872492827379\n",
      "Starting training on ./data/BSD100/img_080.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02371902750936266\n",
      "Finish evaluation\n",
      "Average psnr: 31.25870688534077\n",
      "Average ssim: 0.9436315935277532\n",
      "Starting training on ./data/BSD100/img_081.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.01840712869443999\n",
      "Finish evaluation\n",
      "Average psnr: 36.273719149585\n",
      "Average ssim: 0.9784952350313364\n",
      "Starting training on ./data/BSD100/img_082.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.034822867725447536\n",
      "Finish evaluation\n",
      "Average psnr: 25.00852848002555\n",
      "Average ssim: 0.8057739434747622\n",
      "Starting training on ./data/BSD100/img_083.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.040746401055592366\n",
      "Finish evaluation\n",
      "Average psnr: 23.468263789082418\n",
      "Average ssim: 0.8286767492627382\n",
      "Starting training on ./data/BSD100/img_084.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05008732185076156\n",
      "Finish evaluation\n",
      "Average psnr: 22.521174865077\n",
      "Average ssim: 0.8362745926351366\n",
      "Starting training on ./data/BSD100/img_085.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04670973755047992\n",
      "Finish evaluation\n",
      "Average psnr: 26.117703226264112\n",
      "Average ssim: 0.9107036673627481\n",
      "Starting training on ./data/BSD100/img_086.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04757561755339493\n",
      "Finish evaluation\n",
      "Average psnr: 22.36145751306519\n",
      "Average ssim: 0.7402030106061845\n",
      "Starting training on ./data/BSD100/img_087.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.0358033222355245\n",
      "Finish evaluation\n",
      "Average psnr: 28.600960020863052\n",
      "Average ssim: 0.9014550367170892\n",
      "Starting training on ./data/BSD100/img_088.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03273191476583086\n",
      "Finish evaluation\n",
      "Average psnr: 32.676343283567974\n",
      "Average ssim: 0.9533899370294762\n",
      "Starting training on ./data/BSD100/img_089.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.035845843234714264\n",
      "Finish evaluation\n",
      "Average psnr: 28.193522329438633\n",
      "Average ssim: 0.8557267056045782\n",
      "Starting training on ./data/BSD100/img_090.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04496476798752977\n",
      "Finish evaluation\n",
      "Average psnr: 23.062325609965363\n",
      "Average ssim: 0.7948248748659842\n",
      "Starting training on ./data/BSD100/img_091.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.034105933671480064\n",
      "Finish evaluation\n",
      "Average psnr: 30.387010836211125\n",
      "Average ssim: 0.9162637004234276\n",
      "Starting training on ./data/BSD100/img_092.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04521627858234945\n",
      "Finish evaluation\n",
      "Average psnr: 26.863053474248836\n",
      "Average ssim: 0.8925854604620304\n",
      "Starting training on ./data/BSD100/img_093.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03717819253775797\n",
      "Finish evaluation\n",
      "Average psnr: 33.447590529356724\n",
      "Average ssim: 0.9745692544153767\n",
      "Starting training on ./data/BSD100/img_094.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.049886057811931575\n",
      "Finish evaluation\n",
      "Average psnr: 27.623282785408513\n",
      "Average ssim: 0.9209836340920742\n",
      "Starting training on ./data/BSD100/img_095.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05143172345133187\n",
      "Finish evaluation\n",
      "Average psnr: 26.888167224368313\n",
      "Average ssim: 0.9226943763042192\n",
      "Starting training on ./data/BSD100/img_096.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05272000999936846\n",
      "Finish evaluation\n",
      "Average psnr: 18.570082885030462\n",
      "Average ssim: 0.5131805748263575\n",
      "Starting training on ./data/BSD100/img_097.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.032690211533856935\n",
      "Finish evaluation\n",
      "Average psnr: 27.777989914382346\n",
      "Average ssim: 0.8437008049462779\n",
      "Starting training on ./data/BSD100/img_098.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05174897805228308\n",
      "Finish evaluation\n",
      "Average psnr: 27.920918144709987\n",
      "Average ssim: 0.9315424358187169\n",
      "Starting training on ./data/BSD100/img_099.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.044892038892847555\n",
      "Finish evaluation\n",
      "Average psnr: 28.044069972151515\n",
      "Average ssim: 0.9108455639186088\n",
      "Starting training on ./data/BSD100/img_100.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05113671796416117\n",
      "Finish evaluation\n",
      "Average psnr: 26.535236454831377\n",
      "Average ssim: 0.9055032378182831\n",
      "Average psnr on all images: 27.609140259176225\n",
      "Average ssim on all images: 0.8868365373681212\n"
     ]
    }
   ],
   "source": [
    "train_test_all(\"./data/BSD100\", \"./data/BSD100/unknown_kernel_sr2\", config)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Starting training on ./data/BSD100/img_001.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.0328993215872863\n",
      "Finish evaluation\n",
      "Average psnr: 24.969444243936895\n",
      "Average ssim: 0.8387779920542787\n",
      "Starting training on ./data/BSD100/img_002.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02447401640688272\n",
      "Finish evaluation\n",
      "Average psnr: 28.918156045009063\n",
      "Average ssim: 0.9237172140735677\n",
      "Starting training on ./data/BSD100/img_003.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03861311780235796\n",
      "Finish evaluation\n",
      "Average psnr: 23.37553107880651\n",
      "Average ssim: 0.8677045252465075\n",
      "Starting training on ./data/BSD100/img_004.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.022911923193608644\n",
      "Finish evaluation\n",
      "Average psnr: 33.135763423468774\n",
      "Average ssim: 0.9666888463530467\n",
      "Starting training on ./data/BSD100/img_005.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.032375923374232056\n",
      "Finish evaluation\n",
      "Average psnr: 28.218350811878132\n",
      "Average ssim: 0.9205105549478573\n",
      "Starting training on ./data/BSD100/img_006.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.01757369543082476\n",
      "Finish evaluation\n",
      "Average psnr: 35.1034329066271\n",
      "Average ssim: 0.9702955455088157\n",
      "Starting training on ./data/BSD100/img_007.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04017151307601959\n",
      "Finish evaluation\n",
      "Average psnr: 29.4448319259984\n",
      "Average ssim: 0.9436657607407618\n",
      "Starting training on ./data/BSD100/img_008.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04461972443447134\n",
      "Finish evaluation\n",
      "Average psnr: 20.67875800969079\n",
      "Average ssim: 0.7464128875114157\n",
      "Starting training on ./data/BSD100/img_009.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03741718598259452\n",
      "Finish evaluation\n",
      "Average psnr: 29.93369810858582\n",
      "Average ssim: 0.9434529199182706\n",
      "Starting training on ./data/BSD100/img_010.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.024284727095864263\n",
      "Finish evaluation\n",
      "Average psnr: 31.464112186170354\n",
      "Average ssim: 0.9488764099641341\n",
      "Starting training on ./data/BSD100/img_011.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04172136341669567\n",
      "Finish evaluation\n",
      "Average psnr: 26.892985965779257\n",
      "Average ssim: 0.9202274219058876\n",
      "Starting training on ./data/BSD100/img_012.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03628393357153889\n",
      "Finish evaluation\n",
      "Average psnr: 25.61569244817086\n",
      "Average ssim: 0.8607325146951373\n",
      "Starting training on ./data/BSD100/img_013.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.027498150978188467\n",
      "Finish evaluation\n",
      "Average psnr: 33.37664662651258\n",
      "Average ssim: 0.9641758165732038\n",
      "Starting training on ./data/BSD100/img_014.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.027469625547631327\n",
      "Finish evaluation\n",
      "Average psnr: 25.96545801145624\n",
      "Average ssim: 0.8855050486549381\n",
      "Starting training on ./data/BSD100/img_015.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03188350357746787\n",
      "Finish evaluation\n",
      "Average psnr: 27.243711943793414\n",
      "Average ssim: 0.9127789149963409\n",
      "Starting training on ./data/BSD100/img_016.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05075723142560248\n",
      "Finish evaluation\n",
      "Average psnr: 28.66390594271312\n",
      "Average ssim: 0.9457485828223372\n",
      "Starting training on ./data/BSD100/img_017.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.014313795733970916\n",
      "Finish evaluation\n",
      "Average psnr: 30.85423778231597\n",
      "Average ssim: 0.932695991264349\n",
      "Starting training on ./data/BSD100/img_018.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.01945528994938255\n",
      "Finish evaluation\n",
      "Average psnr: 29.582225268278272\n",
      "Average ssim: 0.937831792392772\n",
      "Starting training on ./data/BSD100/img_019.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03177084389900924\n",
      "Finish evaluation\n",
      "Average psnr: 26.783532418970207\n",
      "Average ssim: 0.8854810148088729\n",
      "Starting training on ./data/BSD100/img_020.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03439308568496528\n",
      "Finish evaluation\n",
      "Average psnr: 27.760102814512926\n",
      "Average ssim: 0.9295854949470764\n",
      "Starting training on ./data/BSD100/img_021.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04479434100045446\n",
      "Finish evaluation\n",
      "Average psnr: 24.618899773847044\n",
      "Average ssim: 0.898924556403057\n",
      "Starting training on ./data/BSD100/img_022.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.043441177358787886\n",
      "Finish evaluation\n",
      "Average psnr: 25.702350927140337\n",
      "Average ssim: 0.8811567289994443\n",
      "Starting training on ./data/BSD100/img_023.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.038529073794684475\n",
      "Finish evaluation\n",
      "Average psnr: 21.796953248804343\n",
      "Average ssim: 0.7026858261084751\n",
      "Starting training on ./data/BSD100/img_024.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.027312003868268764\n",
      "Finish evaluation\n",
      "Average psnr: 28.512842386458157\n",
      "Average ssim: 0.943204762280795\n",
      "Starting training on ./data/BSD100/img_025.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03314350913521197\n",
      "Finish evaluation\n",
      "Average psnr: 30.424840247056263\n",
      "Average ssim: 0.9568324524368327\n",
      "Starting training on ./data/BSD100/img_026.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03441664221546374\n",
      "Finish evaluation\n",
      "Average psnr: 29.960718058484357\n",
      "Average ssim: 0.9552310538078177\n",
      "Starting training on ./data/BSD100/img_027.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03248809318899866\n",
      "Finish evaluation\n",
      "Average psnr: 30.00722853945753\n",
      "Average ssim: 0.9285051440573285\n",
      "Starting training on ./data/BSD100/img_028.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.020160115330386478\n",
      "Finish evaluation\n",
      "Average psnr: 31.646086150755778\n",
      "Average ssim: 0.9533733764689568\n",
      "Starting training on ./data/BSD100/img_029.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.015109318420004118\n",
      "Finish evaluation\n",
      "Average psnr: 33.544775010666534\n",
      "Average ssim: 0.9650827581670781\n",
      "Starting training on ./data/BSD100/img_030.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05419233285410171\n",
      "Finish evaluation\n",
      "Average psnr: 21.347162660009296\n",
      "Average ssim: 0.7993367495519985\n",
      "Starting training on ./data/BSD100/img_031.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.027858502070057727\n",
      "Finish evaluation\n",
      "Average psnr: 32.28553388693041\n",
      "Average ssim: 0.9605463750389545\n",
      "Starting training on ./data/BSD100/img_032.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.05659189274521297\n",
      "Finish evaluation\n",
      "Average psnr: 18.227392295339655\n",
      "Average ssim: 0.605584813760006\n",
      "Starting training on ./data/BSD100/img_033.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04124276684785249\n",
      "Finish evaluation\n",
      "Average psnr: 27.805424525534058\n",
      "Average ssim: 0.9170554683368755\n",
      "Starting training on ./data/BSD100/img_034.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.032006068106029975\n",
      "Finish evaluation\n",
      "Average psnr: 26.062406898518574\n",
      "Average ssim: 0.9141570849589963\n",
      "Starting training on ./data/BSD100/img_035.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.020150652899574538\n",
      "Finish evaluation\n",
      "Average psnr: 36.33203802403391\n",
      "Average ssim: 0.9712242708976154\n",
      "Starting training on ./data/BSD100/img_036.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.039010485040436034\n",
      "Finish evaluation\n",
      "Average psnr: 29.32979103652805\n",
      "Average ssim: 0.9284158071082439\n",
      "Starting training on ./data/BSD100/img_037.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.026142116677385793\n",
      "Finish evaluation\n",
      "Average psnr: 24.59556689717896\n",
      "Average ssim: 0.6935682530464599\n",
      "Starting training on ./data/BSD100/img_038.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.025416484694391773\n",
      "Finish evaluation\n",
      "Average psnr: 28.986268153517628\n",
      "Average ssim: 0.8933226251768652\n",
      "Starting training on ./data/BSD100/img_039.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02989928345921401\n",
      "Finish evaluation\n",
      "Average psnr: 26.1081546725246\n",
      "Average ssim: 0.8518356705933773\n",
      "Starting training on ./data/BSD100/img_040.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02657509297183401\n",
      "Finish evaluation\n",
      "Average psnr: 37.048078118291336\n",
      "Average ssim: 0.9870832899741827\n",
      "Starting training on ./data/BSD100/img_041.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03745374553681362\n",
      "Finish evaluation\n",
      "Average psnr: 28.68783605110965\n",
      "Average ssim: 0.9211129887447177\n",
      "Starting training on ./data/BSD100/img_042.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.030552143255743725\n",
      "Finish evaluation\n",
      "Average psnr: 26.382976672127228\n",
      "Average ssim: 0.8674025561256067\n",
      "Starting training on ./data/BSD100/img_043.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.026752863330253125\n",
      "Finish evaluation\n",
      "Average psnr: 27.94701669200721\n",
      "Average ssim: 0.9137278491264998\n",
      "Starting training on ./data/BSD100/img_044.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.035494754612597317\n",
      "Finish evaluation\n",
      "Average psnr: 28.582169163153818\n",
      "Average ssim: 0.951827609499959\n",
      "Starting training on ./data/BSD100/img_045.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.027713624083854665\n",
      "Finish evaluation\n",
      "Average psnr: 24.54023800309415\n",
      "Average ssim: 0.8489953397858668\n",
      "Starting training on ./data/BSD100/img_046.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.013295135768078892\n",
      "Finish evaluation\n",
      "Average psnr: 32.74136970529637\n",
      "Average ssim: 0.9547345410279147\n",
      "Starting training on ./data/BSD100/img_047.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.043175858420818204\n",
      "Finish evaluation\n",
      "Average psnr: 25.180051418305695\n",
      "Average ssim: 0.8843996775746975\n",
      "Starting training on ./data/BSD100/img_048.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02980252606864393\n",
      "Finish evaluation\n",
      "Average psnr: 26.4535151904971\n",
      "Average ssim: 0.8685428200189258\n",
      "Starting training on ./data/BSD100/img_049.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.052814846730737455\n",
      "Finish evaluation\n",
      "Average psnr: 29.41374660824212\n",
      "Average ssim: 0.9637513675851795\n",
      "Starting training on ./data/BSD100/img_050.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.013612498357003242\n",
      "Finish evaluation\n",
      "Average psnr: 32.812751233244455\n",
      "Average ssim: 0.944108179687591\n",
      "Starting training on ./data/BSD100/img_051.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.035087209049870303\n",
      "Finish evaluation\n",
      "Average psnr: 26.526402435295353\n",
      "Average ssim: 0.8750998223514971\n",
      "Starting training on ./data/BSD100/img_052.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.035791062089782756\n",
      "Finish evaluation\n",
      "Average psnr: 24.806175710420383\n",
      "Average ssim: 0.8884364469162938\n",
      "Starting training on ./data/BSD100/img_053.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.0170669807098497\n",
      "Finish evaluation\n",
      "Average psnr: 33.23343590278254\n",
      "Average ssim: 0.9495273602116807\n",
      "Starting training on ./data/BSD100/img_054.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.014264208498178003\n",
      "Finish evaluation\n",
      "Average psnr: 33.906336663703\n",
      "Average ssim: 0.9437801075002531\n",
      "Starting training on ./data/BSD100/img_055.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.036648225927045364\n",
      "Finish evaluation\n",
      "Average psnr: 29.916353219835074\n",
      "Average ssim: 0.9398325898817527\n",
      "Starting training on ./data/BSD100/img_056.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03570172324668375\n",
      "Finish evaluation\n",
      "Average psnr: 27.417130473113346\n",
      "Average ssim: 0.9076886015295802\n",
      "Starting training on ./data/BSD100/img_057.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.048997295371486296\n",
      "Finish evaluation\n",
      "Average psnr: 18.531364743403728\n",
      "Average ssim: 0.6019198518641055\n",
      "Starting training on ./data/BSD100/img_058.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02331398499770859\n",
      "Finish evaluation\n",
      "Average psnr: 28.731018738609325\n",
      "Average ssim: 0.8986516567299908\n",
      "Starting training on ./data/BSD100/img_059.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.014309793356162228\n",
      "Finish evaluation\n",
      "Average psnr: 31.892218447399166\n",
      "Average ssim: 0.9404984076419184\n",
      "Starting training on ./data/BSD100/img_060.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02050705106308601\n",
      "Finish evaluation\n",
      "Average psnr: 27.71600735532244\n",
      "Average ssim: 0.8610498572950096\n",
      "Starting training on ./data/BSD100/img_061.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.015058512383789215\n",
      "Finish evaluation\n",
      "Average psnr: 32.18090776799677\n",
      "Average ssim: 0.9388186621986329\n",
      "Starting training on ./data/BSD100/img_062.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.021642848051703002\n",
      "Finish evaluation\n",
      "Average psnr: 30.345861305297678\n",
      "Average ssim: 0.9348478251682261\n",
      "Starting training on ./data/BSD100/img_063.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.028278399817111628\n",
      "Finish evaluation\n",
      "Average psnr: 36.185977129807824\n",
      "Average ssim: 0.9863944787580294\n",
      "Starting training on ./data/BSD100/img_064.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04082943173755539\n",
      "Finish evaluation\n",
      "Average psnr: 26.58217998781572\n",
      "Average ssim: 0.9108203377537304\n",
      "Starting training on ./data/BSD100/img_065.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04279295167885783\n",
      "Finish evaluation\n",
      "Average psnr: 23.17177791719031\n",
      "Average ssim: 0.7572540642168404\n",
      "Starting training on ./data/BSD100/img_066.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03616296134783086\n",
      "Finish evaluation\n",
      "Average psnr: 25.617962129473998\n",
      "Average ssim: 0.8733466927502751\n",
      "Starting training on ./data/BSD100/img_067.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.010259523731068126\n",
      "Finish evaluation\n",
      "Average psnr: 38.713977144245256\n",
      "Average ssim: 0.9945311841473004\n",
      "Starting training on ./data/BSD100/img_068.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.06423653282076627\n",
      "Finish evaluation\n",
      "Average psnr: 23.512473988292403\n",
      "Average ssim: 0.878748899308435\n",
      "Starting training on ./data/BSD100/img_069.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.034442007150030415\n",
      "Finish evaluation\n",
      "Average psnr: 23.805807420913997\n",
      "Average ssim: 0.8610499656586409\n",
      "Starting training on ./data/BSD100/img_070.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03133274451051891\n",
      "Finish evaluation\n",
      "Average psnr: 31.77090404906419\n",
      "Average ssim: 0.9574668730161524\n",
      "Starting training on ./data/BSD100/img_071.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.020805520361079414\n",
      "Finish evaluation\n",
      "Average psnr: 31.603477424952423\n",
      "Average ssim: 0.940697912589358\n",
      "Starting training on ./data/BSD100/img_072.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.036285123494969956\n",
      "Finish evaluation\n",
      "Average psnr: 27.759691951047238\n",
      "Average ssim: 0.8920877173602041\n",
      "Starting training on ./data/BSD100/img_073.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03435673637819878\n",
      "Finish evaluation\n",
      "Average psnr: 23.79960573315243\n",
      "Average ssim: 0.752783990413437\n",
      "Starting training on ./data/BSD100/img_074.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03222356120929192\n",
      "Finish evaluation\n",
      "Average psnr: 27.78773031861931\n",
      "Average ssim: 0.89618174932168\n",
      "Starting training on ./data/BSD100/img_075.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04246699343267901\n",
      "Finish evaluation\n",
      "Average psnr: 20.78037286191957\n",
      "Average ssim: 0.7906331096666238\n",
      "Starting training on ./data/BSD100/img_076.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02203509797781118\n",
      "Finish evaluation\n",
      "Average psnr: 27.67494448352869\n",
      "Average ssim: 0.8806039859035425\n",
      "Starting training on ./data/BSD100/img_077.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.0331643844242131\n",
      "Finish evaluation\n",
      "Average psnr: 25.411280207858844\n",
      "Average ssim: 0.8387918073093381\n",
      "Starting training on ./data/BSD100/img_078.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.025505478087280976\n",
      "Finish evaluation\n",
      "Average psnr: 31.714830901472983\n",
      "Average ssim: 0.9499763788130239\n",
      "Starting training on ./data/BSD100/img_079.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.024108776444532354\n",
      "Finish evaluation\n",
      "Average psnr: 34.3581795379205\n",
      "Average ssim: 0.9840936150608717\n",
      "Starting training on ./data/BSD100/img_080.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.017433823775609328\n",
      "Finish evaluation\n",
      "Average psnr: 31.624151169793777\n",
      "Average ssim: 0.9477364310386909\n",
      "Starting training on ./data/BSD100/img_081.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.012720863969046252\n",
      "Finish evaluation\n",
      "Average psnr: 37.25362031354909\n",
      "Average ssim: 0.98176492139512\n",
      "Starting training on ./data/BSD100/img_082.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.024712231024260626\n",
      "Finish evaluation\n",
      "Average psnr: 25.14429275925103\n",
      "Average ssim: 0.8106078466816947\n",
      "Starting training on ./data/BSD100/img_083.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.035675323612798765\n",
      "Finish evaluation\n",
      "Average psnr: 23.976840215557313\n",
      "Average ssim: 0.8407113142677457\n",
      "Starting training on ./data/BSD100/img_084.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04331451164591186\n",
      "Finish evaluation\n",
      "Average psnr: 22.96553719024628\n",
      "Average ssim: 0.8509799025849878\n",
      "Starting training on ./data/BSD100/img_085.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.032788369000880856\n",
      "Finish evaluation\n",
      "Average psnr: 27.121901034608463\n",
      "Average ssim: 0.928034797992295\n",
      "Starting training on ./data/BSD100/img_086.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.04023460379175449\n",
      "Finish evaluation\n",
      "Average psnr: 22.410353278721256\n",
      "Average ssim: 0.7482421261037988\n",
      "Starting training on ./data/BSD100/img_087.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02813548039582624\n",
      "Finish evaluation\n",
      "Average psnr: 28.969383481410258\n",
      "Average ssim: 0.9072583193956426\n",
      "Starting training on ./data/BSD100/img_088.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.026229481811222772\n",
      "Finish evaluation\n",
      "Average psnr: 33.29887247269946\n",
      "Average ssim: 0.9590747290577831\n",
      "Starting training on ./data/BSD100/img_089.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.0289203506429959\n",
      "Finish evaluation\n",
      "Average psnr: 28.51107314226145\n",
      "Average ssim: 0.8628834035213111\n",
      "Starting training on ./data/BSD100/img_090.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03942431104048798\n",
      "Finish evaluation\n",
      "Average psnr: 23.169755003005314\n",
      "Average ssim: 0.7977406448308271\n",
      "Starting training on ./data/BSD100/img_091.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02482933223952306\n",
      "Finish evaluation\n",
      "Average psnr: 30.87183730635298\n",
      "Average ssim: 0.9188403487089859\n",
      "Starting training on ./data/BSD100/img_092.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.03509239091911452\n",
      "Finish evaluation\n",
      "Average psnr: 27.547415181032775\n",
      "Average ssim: 0.9015049401184497\n",
      "Starting training on ./data/BSD100/img_093.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.028804240174008944\n",
      "Finish evaluation\n",
      "Average psnr: 34.5131811382197\n",
      "Average ssim: 0.9784650151696921\n",
      "Starting training on ./data/BSD100/img_094.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.039197939357726336\n",
      "Finish evaluation\n",
      "Average psnr: 28.30938858163226\n",
      "Average ssim: 0.9263073291945035\n",
      "Starting training on ./data/BSD100/img_095.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.040033072065324846\n",
      "Finish evaluation\n",
      "Average psnr: 28.354676047215982\n",
      "Average ssim: 0.9401466666873443\n",
      "Starting training on ./data/BSD100/img_096.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.044654203917560246\n",
      "Finish evaluation\n",
      "Average psnr: 18.50228957022939\n",
      "Average ssim: 0.5030877730486981\n",
      "Starting training on ./data/BSD100/img_097.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.02373586638411721\n",
      "Finish evaluation\n",
      "Average psnr: 27.93229929380631\n",
      "Average ssim: 0.8437605673869178\n",
      "Starting training on ./data/BSD100/img_098.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.039791362002764126\n",
      "Finish evaluation\n",
      "Average psnr: 28.144759655568762\n",
      "Average ssim: 0.9346141703053831\n",
      "Starting training on ./data/BSD100/img_099.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.035000171628214144\n",
      "Finish evaluation\n",
      "Average psnr: 28.772157257722064\n",
      "Average ssim: 0.925164763500146\n",
      "Starting training on ./data/BSD100/img_100.png with resolution factor 2\n",
      "Done training.\n",
      "Avg training loss is 0.039446684746616174\n",
      "Finish evaluation\n",
      "Average psnr: 27.01181644452516\n",
      "Average ssim: 0.9140870257724091\n",
      "Average psnr on all images: 28.24924746698693\n",
      "Average ssim on all images: 0.8931722223382872\n"
     ]
    }
   ],
   "source": [
    "config[\"model\"] = \"zssr\"\n",
    "train_test_all(\"./data/BSD100\", \"./data/BSD100/unknown_kernel_sr2\", config)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
